package com.android.marble;

import com.stickycoding.rokon.Sprite;
import com.stickycoding.rokon.Texture;

public class BloodProgress extends Sprite{
    
    private static final int WIDTH = 200;
    private static final int HEIGHT = 20;
    private Texture mTexture;
    private int mBloodValue = 5;

    public BloodProgress(float x, float y) {
        super(x, y, WIDTH, HEIGHT);  
        mTexture = Textures.blood_5;
    }
    /**
     * creat a blood progress.
     */
    public void creat(){        
        setTexture(mTexture);        
    }
    /**
     * Update the texture of blood progress. I mean update the blood value;
     */
    private void update(){
        if(mBloodValue == 5) mTexture = Textures.blood_5;
        else if(mBloodValue == 4)mTexture = Textures.blood_4;
        else if(mBloodValue == 3)mTexture = Textures.blood_3;
        else if(mBloodValue == 2)mTexture = Textures.blood_2;
        else if(mBloodValue == 1)mTexture = Textures.blood_1;
        else mTexture = Textures.blood_0;
        
        setTexture(mTexture);
    }
    public void decrease(){
        mBloodValue -= 1;
        update();
    }

}
